﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SCSService;

namespace SCS.Core.Models.ModelsFontend
{
    public class ArticaleModel
    {
        #region "Category"
        public static List<Article_Category> GetListArticleCategoryByParentId(int? parentId, int languageID, int siteGuid, bool? active)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleCategoryByParentID(parentId,languageID,siteGuid,active);
        }

        public static List<Article_Category> GetListArticleCategoryByParentIdAndLevel(int? level,int? parentId, int languageID, int siteGuid, bool? active)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleCategoryByParentIDAndLevel(level,parentId, languageID, siteGuid, active);
        }

        public static int CheckLevelArticleCategory(int? id, int languageID, int siteGuid, bool? active)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.CheckLevelArticleCategory(id, languageID, siteGuid, active);
        }

        public static Article_Category GetArticleCategory(int id)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetArticleCategoryByID(id);
        }

        public static IEnumerable<Article_Category> GetListArticleCategory(int languageID, int siteGuid, bool? active)
        {
            var list = GetListArticleCategoryByParentId(null,languageID,siteGuid,active);
            return (from p in list
                    select p);
        }
        #endregion

        #region "Article"
        public static List<Article> GetListArticleByCategory(int? cateId, int languageID, int siteGuid)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleByCategory(cateId,languageID,siteGuid);
        }

        public static Article GetArticleByID(int id)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetArticle(id);
        }

        public static List<Article_Frontpage> GetListArticleFrontpageByArticleID(int id)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleFrontpageByArticleID(id);
        }

        public static List<Article> GetListTopArticleNews(int? cateID, int LanguagesID, int siteGuid, int numberTop)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListTopArticleNews(cateID,LanguagesID,siteGuid,numberTop);
        }
        #endregion

        #region "StaticCategory"
        public static List<Artilce_Static_Category> GetListArticleStaticCategoryByParentId(int? parentId, int languageID, int siteGuid, bool? active)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticCategoryByParentID(parentId, languageID, siteGuid, active);
        }

        public static List<Artilce_Static_Category> GetListArticleStaticCategoryByParentIdAndParam(int? parentId, int languageID, int siteGuid, bool? active,string param)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticCategoryByParentIDSearch(parentId, languageID, siteGuid,null,null,param,null, active,null,null);
        }

        public static Artilce_Static_Category GetArticleStaticCategory(int id)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetArticleStaticCategoryByID(id);
        }

        public static IEnumerable<Artilce_Static_Category> GetListArticleStaticCategory(int languageID, int siteGuid, bool? active)
        {
            var list = GetListArticleStaticCategoryByParentId(null, languageID, siteGuid, active);
            return (from p in list
                    select p);
        }

        public static List<Artilce_Static_Category> GetListArticaleStaticCategoryBySiteGuidAndLanguageIDAndParam(int languageID, int siteGuid, string param)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticaleStaticCategoryBySiteGuidAndLanguageIDAndParam(languageID,siteGuid,param);
        }
        #endregion

        #region "Article_Static"
        public static List<Article_Static> GetListArticleStaticByCategory(int? cateId, int languageID, int siteGuid,bool? active)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticByCategory(cateId, languageID, siteGuid, active);
            
        }

        public static List<Article_Static> GetListArticleStaticByCategoryNotParam(int? cateId, int languageID, int siteGuid, bool? active)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticByCategoryNotParam(cateId, languageID, siteGuid, active);

        }

        public static List<Article_Static> GetListArticleStaticByCategoryAndOnlyParam(int? cateId, int languageID, int siteGuid,string param, bool? active)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListArticleStaticByCategoryAndOnlyParam(cateId, languageID, siteGuid,param, active);

        }

        public static Article_Static GetArticleStaticByID(int id)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetArticleStaticByID(id);
        }

        public static List<Article_Static_Frontpage> GetListArticleStaticFrontpageByArticleStaticID(int id)
        {
            ArticleService artSvc = new ArticleService();
            return artSvc.GetListStaticArticleFrontpageByArticleStaticID(id);
        }
        #endregion
    }
}
